<include file="Public:header" />
    <div class="wrap_left">
        <div class="rbox5">
            <div class="rbox5_top"></div>
            <div class="rbox5_center">
                <h2>{$title}</h2>
				<volist name="list" id="vo">
					<a href="{$vo.url}" style="margin:5px 10px">{$vo.title}</a>
				</volist>
            </div>
            <div class="rbox5_bottom"></div>
        </div><!--链接信息-->
        
        <div class="rbox5">
            <div class="rbox5_top"></div>
            <div class="rbox5_center">
                <h2>申请链接</h2>
                <div id="postTemp"></div>
				<div id="ajaxContent"></div>
                <div class="sub_form">
                        <div>
                            <table><tr><td>
                            <img src="__URL__/verify" alt="点击刷新验证码" id="verifyImg" class="code" onclick="this.src+='?' + Math.random();" /></td><td>
                            <input type="text" name="verify" id="verify" class="short" maxlength="4" />
                            <label class="required">验证码（必须）</label></td></tr></table>
                        </div>
                        <div>
                            <input type="text" name="title" id="title" class="long" />
                            <label class="required">网站名称（必须）</label>
                        </div>
                        <div>
                            <input type="text" name="url" id="url" class="long" />
                            <label class="required">网站地址（必须）</label>
                        </div>
                        <div>
                            <input type="text" name="intro" id="intro" class="long" />
                            <label>网站简介</label>
                        </div>
						<div>
                            <input type="submit" class="button" value="" onclick="return chksub()" />
                        </div>                            
                </div>
            </div>
            <div class="rbox5_bottom"></div>            
        </div><!--发表评论-->
		<script>
		function chksub(){
		    if($("#verify").val() == ''){
		        alert('请输入验证码！');
		        $("#verify").focus();
		        return false;
		    }
		    if($("#title").val() == ''){
		        alert('请输入网站名称！');
		        $("#title").focus();
		        return false;
		    }
		    if($("#url").val() == ''){
		        alert('请输入网站地址！');
		        $("#url").focus();
		        return false;
		    }
		    postData();
		}
		
		//提交链接
		function postData(){
			$("#postTemp").html('<div class="pop">正在发表，请稍等。。。</div>');
			$.post("__URL__/add", {"verify":$("#verify").val(),"title":$("#title").val(),"url":$("#url").val(),"intro":$("#intro").val()}, function(msg) {
				$("#postTemp").html(msg);
				$("#verify").val('');
				$("#title").val('');
				$("#url").val('');
				$("#intro").val('');
				$("#verifyImg").attr("src",function(){this.src+='?'+Math.random();});
				$(".pop").fadeOut(3000);
			});
		}
		</script>
    </div>        
<include file="Public:footer" />
